﻿<%@ Page Title="" Language="C#" MasterPageFile="~/LeftColumn.master" AutoEventWireup="true" CodeBehind="CategoryProductsInStock.aspx.cs" Inherits="Supermarket.Web.CashierPages.Inquires.CategoryProductsInStock" %>
<asp:Content ID="Content1" ContentPlaceHolderID="RightContent" runat="server">
    <asp:DropDownList ID="ddlCategory" runat="server" AutoPostBack="True" 
        DataSourceID="odsCategory" DataTextField="CategoryName" 
        DataValueField="CategoryId">
    </asp:DropDownList>
    <asp:ObjectDataSource ID="odsCategory" runat="server" 
        SelectMethod="GetAllCategories" TypeName="Supermarket.Bll.CategoryManager"></asp:ObjectDataSource>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="upProducts" runat="server">
        <ContentTemplate>
            <h2>Всички налични стоки към момента</h2>
            <asp:GridView ID="GridViewProducts" runat="server" AllowPaging="True" 
                AllowSorting="True" AutoGenerateColumns="False" BackColor="#DEBA84" 
                BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
                CellSpacing="2" DataSourceID="odsProducts" 
                EnableViewState="False" PageSize="15" 
                onrowdatabound="GridViewProducts_RowDataBound" ShowFooter="True" 
                DataKeyNames="ProductId">
                <Columns>
                    <asp:BoundField DataField="ProductName" HeaderText="Продукт" 
                        SortExpression="ProductName" />
                    <asp:BoundField DataField="CategoryName" HeaderText="Категория" 
                        SortExpression="CategoryName" />
                    <asp:BoundField DataField="InStock" HeaderText="Наличност" 
                        SortExpression="InStock" />
                    <asp:BoundField DataField="ProductPrice" 
                        HeaderText="Ед. цена" SortExpression="ProductPrice" 
                        DataFormatString="{0:0.00}" />
                    <asp:BoundField DataField="TotalItemPrice" 
                        HeaderText="Цена" SortExpression="TotalItemPrice" 
                        DataFormatString="{0:0.00}" />
                </Columns>
                <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                <SortedAscendingCellStyle BackColor="#FFF1D4" />
                <SortedAscendingHeaderStyle BackColor="#B95C30" />
                <SortedDescendingCellStyle BackColor="#F1E5CE" />
                <SortedDescendingHeaderStyle BackColor="#93451F" />
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:ObjectDataSource ID="odsProducts" runat="server" SortParameterName="sortExpression"
        SelectMethod="GetAllProducts" TypeName="Supermarket.Bll.InquireManager">
        <SelectParameters>
            <asp:ControlParameter ControlID="GridViewProducts" Name="sortExpression" 
                PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="ddlCategory" Name="categoryId" 
                PropertyName="SelectedValue" Type="Int32" DefaultValue="-1" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
